<%--
  Created by IntelliJ IDEA.
  User: 林家豪
  Date: 2020/9/24
  Time: 17:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>历史订单</title>
</head>
<style>
    #frame,.frame1,.frame2,.message{
        width: 700px;
        height: auto;
    }
    #button-box{
        width: 30px;
        height: 30px;
        position: fixed;
        left: 720px;
        top: 20px;
    }
    .img{
        width: 200px;
        height: auto;
        float: left;
    }
    img{
        width: 200px;
        height: 200px;
        float: left;
    }
    .message1{
        width: 496px;
        height: auto;
        float: left;
    }
    .color{
        width: 700px;
        height: 10px;
        background-color: #3c9de8;
    }
</style>
<body>
    <div id="frame">
        <c:forEach items="${objects}" var="user"  varStatus="v">
            <div class="frame1">
               <c:forEach items="${user}" var="message" varStatus="v">
                   <div class="frame2">
                       <div class="message">
                           <div class="img">
                           <img src="${pageContext.request.contextPath}/${message.categoryimg}">
                           </div>
                           <div class="message1">
                               <p>产品参数:${message.goodsattribute}</p>
                               <p>产品详情:${message.goodsdescription}</p>
                               <p>购买数量:${message.price}</p>
                               <p>产品价格:${message.count}</p>
                               <p>原价 :${message.price * message.count}  以优惠 : ${message.price * message.count - message.detailTotalPrice}</p>
                               <p>实付金额:${message.detailTotalPrice}</p>
                           </div>
                       </div>
                           <c:if test="${v.index<1}">
                               <div class="frame2">
                                   <label for="takeName">收货人:</label>
                                   <span id="takeName">${message.takeName}</span>
                                   <label for="phone">收货人号码:</label>
                                   <span id="phone">${message.phone}</span>
                                   <label for="adress">收货地址:</label>
                                   <span id="adress">${message.orderadress}</span>
                                   <label for="yuanjia">原价 :</label>
                                   <span id="yuanjia">${message.price * message.count}</span>
                                   <label for="youhui">以优惠 :</label>
                                   <span id="youhui">${message.price * message.count - message.detailTotalPrice}</span>
                                   <label for="price">实付金额:</label>
                                   <span id="price">${message.orderTotalPrice}</span>
                                   </div>
                           </c:if>
                       </div>
                   </div>
               </c:forEach>
            </div>
            <div class="color"></div>
        </c:forEach>
    </div>
    <div id="button-box">
        <button id="buttons" onclick="goBack()">返回主页面</button>
    </div>
<script>
    function goBack() {
        window.location.href="${pageContext.request.contextPath}/index.jsp";
    }
</script>
</body>
</html>
